package com.guigu.www.mapper;

import com.guigu.www.pojo.HealthManager;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author DengHao
 * @since 2021-10-21
 */
public interface HealthManagerMapper extends BaseMapper<HealthManager> {

    // 邓浩添加 用于查询总销售额
    @Select("SELECT SUM(bes_sm_price) FROM  bespeak bes,bespeak_set_meal bsm WHERE bes.`bes_sm_id`=bsm.`bes_sm_id` AND bes.`bes_ispay`=0 ")
    Integer queryTotalMoney();

    // 邓浩添加 用于查询你所给日期当天的销售额
    @Select("SELECT SUM(bes_sm_price) FROM  bespeak bes,bespeak_set_meal bsm WHERE bes.`bes_sm_id`=bsm.`bes_sm_id` AND bes.`bes_ispay`=0 AND bes.`bes_create_time` LIKE #{time} ")
    Integer queryDayMoney(@Param("time") String time);

    // 陈显科 用于查询健康师表
    @Select("SELECT * FROM health_manager WHERE hm_display_state=0 ORDER BY hm_display_order")
    List<HealthManager> selectManager();
}
